import {makeExecutableSchema} from "graphql-tools";
import resolvers from "./resolvers";
import cmd from "./cmd";
import defaultParams from './defaultParams';
const schema = `
scalar JSON

# the schema allows the following query:
type Query {
  cmd( 
    page: Int
    pageSize: Int
    code:String
    description:String
  ):CmdList
  defaultParams(
    pageSize: Int
    page: Int
    params: paramsInput
  ):paramsList
}
# this schema allows the following mutation:
type Mutation {
    #新建cmd
    createCmd (
        cmd:CmdInput
    ): CmdList
    #更新cmd
    updateCmd(id:String, cmd: CmdInput):Cmd
    #删除cmd
    deleteCmd(id:String): CmdList
    #新建默认参数
    createDefparam (param: paramsInput): DefaultParams
    #更新默认参数
    updateDefparam (_id:String, params: paramsInput): DefaultParams
    #删除默认参数
    deleteParams(_id:String):paramsList
}
`;
export default makeExecutableSchema({
    typeDefs: [cmd, defaultParams, schema],
    resolvers
});
